<script
  src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=<%=GOOGLE_MAPS_KEY%>" type="text/javascript"></script>

<div id="page_description">
    Seimo darbas per 30 dienų: posėdžiai, kelionės, priimti teisės aktai. Paskutiniai pranešimai spaudai.
</div>


<div style="float:left">

  <div class="infobox">
    <h2 class="infobox_title">Dienos nuotrauka</h2>
    <img style="width:450px;" src=<%=@img_src%>/>
    <div style="margin-top:5px">
      <p><%=@img_alt%> <a id="inlist" href='<%=@img_url%>'>(iš www.lrs.lt)</a></p>
    </div>
  </div>

  <div class="infobox">
    <h2 class="infobox_title">Seimo narių kelionės</h2>
    <table width="100%">

      <%@trips.each do |trip| %>
        <tr>
          <td style="padding-right:3px;padding-bottom:5px;"><img src='/images/flags/<%=trip.state.iso_id.downcase%>.gif'/></td>
          <td style="padding-right:3px;padding-bottom:5px;"><%=h trip.state.state_labels.first.label%></td>
          <td style="padding-right:3px;padding-bottom:5px;"><%=h trip.politician.full_name%></td>
          <td style="padding-right:3px;padding-bottom:5px;"><%=h trip.start_date.to_s%></td>
        </tr>
      <%end%>
    </table>
  </div>

  <div class="infobox">
    <h2 class="infobox_title">Pranešimai spaudai</h2>
    <table>
      <%@feed.each do |item|%>
        <tr>
          <td style="padding-right:3px;padding-bottom:5px;vertical-align:top"><%=h item[:date]%></td>
          <td style="padding-bottom:5px;"><a id="inlist" href="<%=item[:link]%>"><%=item[:title]%></a></td>
        </tr>
      <%end%>
    </table>
  </div>

</div>

<div style="margin-left:30px;float:left">

  <div class="infobox">
    <h2 class="infobox_title">Seimo posėdžiai</h2>
    <table style="width:100%">
      <%@sittings.each do |sitting| %>
        <tr>
          <th rowspan="3" style="vertical-align:top"><%=h sitting.date%></th>
          <td>Lankomumas:</td>
          <td align="left"><%=h stat_percent(
              Attendance.count(:conditions=>{:sitting_id=>sitting.id, :present=>true}),
              141)%></td>
        </tr>
        <tr>
          <td>Dalyvavo balsavime:</td>
          <td align="left"><%=h stat_percent(
              sitting.votes.count(:conditions=>["action in (?,?)", Vote::ABSENT, Vote::NOVOTE]),
              sitting.votes.count
            )%></td></tr>
        <tr>
          <td style="padding-bottom:10px;">Svarstyti klausimai:</td>
          <td style="padding-bottom:10px;" align="left"><%=sitting.questions.count%></td>
        </tr>
      <%end%>
    </table>
  </div>

  <div class="infobox">
    <h2 class="infobox_title">Priimti teisės aktai</h2>
    <table>
      <%@sittings.each do |sit|%>
        <%sit.approved_questions.each do |q|%>
          <%
          aye = PoliticalGroupVote.sum(:action_yes, :conditions=>{:question_id => q.id})
          nay = PoliticalGroupVote.sum(:action_no, :conditions=>{:question_id => q.id})
        %>
          <tr>
            <td style="vertical-align:top;padding-right:4px;padding-bottom:5px;">
              <%= sparkline_tag [aye * 100.0 / (aye + nay)],
                :type => 'pie',
                :diameter => 18,
                :share_color => '#1695A3',
                :remain_color => '#F3FFE2' %>
            </td>
            <td style="padding-bottom:5px;"><%=h q.formulation%></td>
          </tr>
        <%end%>
      <%end%>
    </table>
  </div>
</div>

<script type="text/javascript">
    endProgress();
</script>

